/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIBA_WIN32_REGISTRY_H__
#define __LIBA_WIN32_REGISTRY_H__

#include <string>

namespace liba
{
namespace win32
{
namespace registry
{

//About windows registry:
//Windows registry is a tree; nodes of that tree are keys.
//Each key contains a number of values (and subkeys as well).
//Each value has its name and data associated with it.
//Each data has its type.
//(only string and long types are supported in this implementation,
//but you may add support of other data types).
	
//Usage:
//if one needs to write the "_data_" data in the "_value_" value within the "_key_" node,
//he needs to call write("_key_", "_value_", "_data_").
//Real example: write("HKEY_CURRENT_USER\\Software\\MyProduct\\Info", "Version", 1.2);
//Note that key name is case sensitive, and forward slashes are not allowed (use only backslashes).
//Note also that forward slashes are allowed in registry key names (!):
//the "..\\Software\\MyProduct/version" parameter will produce
//the "MyProduct/version" key which will be the child of the "..\\Software" key.


//read/write values of string type
bool write(const std::string & key, const std::string & value, const std::string & data);
bool read(const std::string & key, const std::string & value, std::string * data);

//read/write long values of long type
bool write(const std::string & key, const std::string & value, long data);
bool read(const std::string & key, const std::string & value, long * data);

//delete value or key
bool delete_key(const std::string & key);
bool delete_value(const std::string & key, const std::string & value);

} // namespace registry
} // namespace win32
} // namespace liba
using namespace liba;

#endif // __LIBA_WIN32_REGISTRY_H__

